package com.mingqijia.gassafety.webserver.request;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * @author  zm
 * @className   FuncAreaAddRequest
 * @Description
 * @createTime 2024/7/9 15:29
 */
@Data
public class FuncAreaAddRequest {


    @ApiModelProperty(value = "区域名称",required = true)
    @NotNull(message = "区域名称不能为空")
    @Length( max = 250, message = "区域名称不能超过250个字符")
    private String funcName;

    @ApiModelProperty(value = "显示顺序",required = true)
    @NotNull(message = "显示顺序不能为空")
    private Integer ordinal = 0;

    @ApiModelProperty(value = "父级id")
    private Integer pid = 0;

    @ApiModelProperty(value = "级别 1：功能区 2：街道 3：商圈",required = true)
    @NotNull(message = "级别不能为空")
    @Min(value = 1, message = "级别数值错误,1：功能区 2：街道 3：商圈")
    @Max(value = 3, message = "级别数值错误,1：功能区 2：街道 3：商圈")
    private Integer level = 1;

    @ApiModelProperty(value = "围栏,格式：lng,lat;lng,lat#lng,lat;lng,lat  不同经纬度之间用;分隔，不同围栏用#分隔")
    private String fence;

    @ApiModelProperty(value = "围栏中心点,格式：lng,lat#lng,lat 不同围栏中心点用#分隔")
    private String centerPoint;

    public void setFuncName(String funcName) {
        this.funcName = funcName != null ? funcName.trim() : null;
    }

}
